Movement Models¶
Base Class¶
Base class for all movement models.
-
class
ollin.movement_models.base.
MovementModel
(parameters=None)[source]¶ Base class for all movement models.
Any movement model must subclass this class and implement the generate movement method. Also they must provide a global attribute defining the default parameters for any instance of the movement model.
-
name
¶ str – Name of model. Mainly used in plotting.
-
default_parameters
¶ dict – Dictionary holding default values of any parameters associated with the movement model. There are some required parameters for every movement model. If not provided they will default to those in
constants
.
-
generate_movement
(initial_position, site, steps, velocity)[source]¶ Generate simulated movement from initial positions and conditions.
This is an abstract method that must be implemented in any subclass.
Parameters: - initial_position (array) – Array of initial positions of shape [num, 2] to specify coordinates of individuals to be simulated.
- site (
Site
) – Site in which to simulate movement. - steps (int) – Number of steps to simulate.
- velocity (int) – Mean velocity of individuals.
Returns: array – Array of shape [num, steps, 2], so if (x, y) = Array[i, j, :] then x and y are the coordinates of the i-th individual at step j in the simulation. Number of steps is determined by number of days and steps per day parameter.
Return type: array
-
handle_parameters
(params)[source]¶ Return parameter dictionary values with missing default values.
This function searchs for all required parameters in the dictionary passed as argument. If not found it will default to the value specified in the default_parameters dictionary of the movement model class. If not found it will default to the one specified in the constants module. (see
constants
)
-
Too see all available Movement Models see Movement Models Library.